IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_SrvrInstncDatabaseFileMSSQL_SrvrInstncDatabase]') AND parent_object_id = OBJECT_ID(N'[dbo].[SrvrInstncDatabaseFileMSSQL]'))
BEGIN
     ALTER TABLE [dbo].[SrvrInstncDatabaseFileMSSQL] DROP CONSTRAINT [FK_SrvrInstncDatabaseFileMSSQL_SrvrInstncDatabase]
END
GO

ALTER TABLE [dbo].[SrvrInstncDatabaseFileMSSQL] WITH CHECK ADD CONSTRAINT [FK_SrvrInstncDatabaseFileMSSQL_SrvrInstncDatabase] 
     FOREIGN KEY([SrvrInstncDatabaseId]) REFERENCES [dbo].[SrvrInstncDatabase] ([SrvrInstncDatabaseId])
GO
